FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["Business.Host/Business.Host.csproj", "Business.Host/"]
COPY ["Business.HttpApi/Business.HttpApi.csproj", "Business.HttpApi/"]
COPY ["Business.Application.Contracts/Business.Application.Contracts.csproj", "Business.Application.Contracts/"]
COPY ["Business.Application/Business.Application.csproj", "Business.Application/"]
COPY ["Business.Domain/Business.Domain.csproj", "Business.Domain/"]
COPY ["Business.Core/Business.Core.csproj", "Business.Core/"]
COPY ["Business.EntityFrameworkCore/Business.EntityFrameworkCore.csproj", "Business.EntityFrameworkCore/"]
RUN dotnet restore "Business.Host/Business.Host.csproj"

COPY . .
RUN dotnet publish -c Release -o publish

FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
COPY --from=build /src/publish ./
ENTRYPOINT ["dotnet", "Business.Host.dll"]